<?php include("../../MerchandiseBay/conn.php"); 


$firstname=$_REQUEST['firstname'];
$lastname=$_REQUEST['lastname'];
$username=$_REQUEST['username'];
$password=$_REQUEST['password'];
$telno=$_REQUEST['telno'];
$address=$_REQUEST['location'];
$email=$_REQUEST['email'];

$SQL="select * from users where username='$username'";
$qry=mysql_query($SQL,$conn);


?>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<?
if(mysql_num_rows($qry)>0) 
{ 
$row=mysql_fetch_assoc($qry);
?>
<font size="2" face="Verdana">
<?=$location?>
</font>
<div align="center">
<table width="359" border="0" align="left" bordercolor="#333333" style="border-collapse: collapse"><tr><td>
	<table width="102%" border="0" align="left" id="table1">
		<tr>
			<td background="../../mc/images/background/m3.jpg"><font face="Verdana" size="4" color="#FF0000">&nbsp;Error 
              ! </font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp; Cannot use the Username. the username already use someone  &nbsp;&nbsp;else. </font></td>
		</tr>
		<tr>
			<td><font face="Verdana" size="2">&nbsp; Username : <?echo $row['username']?></font></td>
		</tr>
		<tr>
			<td align="center">
			<input type="button" value="Back" name="B4" onClick="history.back();"></td>
		</tr>
	</table></td></tr></table>
</div>
<? }
else {

$adduserSQL="insert into users (username,password,firstname,lastname,telno,location,email) values('$username','$password','$firstname','$lastname','$telno','$address','$email')";
$adduserQuery=mysql_query($adduserSQL,$conn);


?>
<div align="left"></div>
<div align="center">
<table width="359" border="0" align="left" bordercolor="#333333" style="border-collapse: collapse"><tr><td>
	<table border="0" width="102%" id="table1">
		<tr>
			<td background="../../mc/images/background/blueBG.gif"> <font color="#0033FF" size="4" face="Verdana">Success ! Your information 
              succesfully write in our record. </font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;First Name : <?=$firstname?></font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;Last Name : <?=$lastname?></font></td>
		</tr>

		<tr>
			<td><font size="2" face="Verdana">&nbsp;Username &nbsp;: <?=$username?></font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;Password &nbsp;: <?=$password?></font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;Tel. No &nbsp;&nbsp;&nbsp;&nbsp;: 
              <?=$telno?>
              </font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;Location&nbsp;&nbsp;&nbsp;: 
              <?=$address?>
              </font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;E-mail &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <?=$email?></font></td>
		</tr>
		<tr>
			<td>
			<p align="center"><font size="2" face="Verdana"> <a href="userregister.html">User Registration</a></font></td>
		</tr>
	</table></td></tr></table>
</div>
<?}?>
</body>

</html>